<template>
    <hd-login :loginStyle="loginStyle" :fun="beforeLogin" title="欢迎您登录系统" desc="请输入账号和密码，谢谢"></hd-login>
</template>

<script>
import bg from '@/assets/images/lo.png'
import { mapActions } from 'vuex'

export default {
  data () {
    return {
      loginStyle: {
        backgroundImage: 'url(' + bg + ')'
      }
    }
  },
  methods: {
    ...mapActions([
      'getUserInfo'
    ]),
    async beforeLogin () {
      let rest = await this.getUserInfo()
      console.log(rest)
      if (rest.errcode === 0) {
        return true
      } else {
        return true
      }
    }
  }
}
</script>
